<template>
	<view class="home">
		<image class="img" src="@/static/logoa.png" mode=""></image>
				<view class="toplist">
					<view class="topitem">
						<text>版本号：</text>
						<text>{{versi}}</text>
					</view>
				</view>
				<view class="text-arc">
					<view class="box" hover-class="hvbox" @click="uplodeFn">
						检查新版本
					</view>
				</view>
		<!-- 更新 -->
		<wrap-version-update ref="updateref" :auto="false" id="571400171917381" @finish="landleFinish"
			@check="landlecheck"></wrap-version-update>
		<!-- 更新 -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				versi: '',
			}
		},
		onShow() {
			setTimeout(()=>{
				this.$refs.updateref.check()
				console.log('更新');
			},300)
		},
		onLoad(option) {

		},
		methods: {
			landlecheck(e) {
				this.versi = e.version
			},
			uplodeFn() {
				this.$refs.updateref.check()
			},
			landleFinish() {
				this.flag = true
				if (this.flag) {
					uni.showToast({
						title: '已经是最新版本'
					})
				}
			},
			
		}
	}
</script>
<style scoped lang="scss">
	.text-arc {
		text-align: center;
		margin-top: 130rpx;
		color: #000;
		font-size: 30rpx;
		.box {
			width: 200rpx;
			padding: 20rpx;
			border: 5rpx solid #000000;
			border-radius: 30rpx;
			margin-top: 50rpx;
			background-color: #a9fd69;
		}
		.hvbox {
			background-color: #bde8ff;
		}
	}
	.home {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		.img {
			width: 300rpx;
			height: 300rpx;
			margin-top: 200rpx;
		}
		.toplist {
			display: flex;
			justify-content: center;
			font-size: 40rpx;
			.topitem {
				width: 550rpx;
				margin: 30rpx 0 0 0;
				padding: 30rpx 50rpx;
				border-radius: 50rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: #435274;
				background-color: #bde8ff;
				border: 5rpx  solid #000000;
			}
		}
	}
</style>
<style>
	page {
		background-color: #cde7ff;
	}
</style>